import backtrader as bt


class SmaCross(bt.Strategy):
    params = dict(period=5)

    def __init__(self):
        self.move_average = bt.ind.MovingAverageSimple(
            self.data.close, period=self.params.period
        )
        print("init")


class TALibStrategy(bt.Strategy):
    params = ("period", 20)

    def __init__(self):
        # tb-lib 移动平均线指标
        self.sma = bt.talib.T3(self.data, timeperiod=self.p.period)


print("ok")
print(bt.__version__)
